<html>

<head>
    <title></title>
    <style>
        *, html, body {
            font-size: 0.99em;
        }
        .heading1 {
            margin-left: 60px;
        }
        .heading2 {
            margin-left: 60px;
        }
        .heading2 {
            margin-left: 30px;
        }
        pre { 
            border: 1px solid #000;
            padding: 5px;
        }
        .command {
            color: #AAA;
        }
        .grep { 
            font-family: monospace;
        }
        .grep_filepath {
            color: #00F;
        }
        .grep_line {
            color: #5A5;
        }
        .grep_keyword {
            color: #F00;
        }
        .hide {
            color: #AAA;
        }
        .warning {
            color: #F00;
        }
        .infos {
            font-size: 10pt;
            font-style: italic;
        }
        .unit {
            margin-left: 150px;
            border: 1px solid #000;
        }
    </style>
</head>

<body>
    <ul id="menu"></ul>

    <div class="heading heading1">
        <h1>Basic Information</h1>
        <div id="infos">
            <div>Report Date: {{ date }}</div>
            <div>Package: {{ package_name }}</div>
            <div>Build: {{ build }}</div>
            <div>Android Version: {{ android_version }}</div>
        </div>
    </div>
    <hr />

    <div class="heading heading1">
        <h1>Permissions</h1>
        <div id="infos">
            <div>{{ permissions }}</div>
        </div>
    </div>
    <hr />

    <div class="heading heading1">
        <h1>Dangerous Permissions</h1>
        <div id="infos">
            <div>{{ dangerous_permission }}</div>
        </div>
    </div>
    <hr />

    <div class="heading heading1">
        <h1>Intents</h1>
        <div class="grep">{{ intent_grep }}</div>
    </div>
    <hr />

    <div class="heading heading1">
        <h1>Storage</h1>

        <div class="heading heading2">
            <h2>Internal storage</h2>
            <div class="grep">{{ internal_storage_grep }}</div>
        </div>

        <div class="heading heading2">
            <h2>External storage</h2>
            <div class="grep">{{ external_storage_grep }}</div>
        </div>
    </div>
    <hr />

    <!-- Your JavaScript stays the same -->
    <script type="text/javascript" src="jquery-3.4.1.slim.min.js"></script>
    <script>
        var cur = 1;
        var str = '';
        var menu = $('#menu');
        $('body').find(':header').each(function(index){
            lvl = $(this).prop('tagName').replace('H','');
            if( lvl > cur ) {
                str = str + '<ul>';
            } else if( lvl < cur ) {
                str = str + '</ul>';
            }
            cur = lvl;
            str = str + '<li><a href="">' + $(this).text() + '</a></li>';
        });
        menu.append( str );
    </script>

</body>

</html>